<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<%@include file="/common/javascript.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>历史资料</title>
    
    <script type="text/javascript">
    	var dialog;
        var gridManager = null;
        $(function ()
        {
            $("#maingrid").ligerGrid({
                columns: [
                {name: 'id', hide:true,width:"1%"},
                { display: '主题', name: 'topic', align: 'left', width:'33%', minWidth: 120 },
                { display: '解答老师', name: 'teaName', width:'20%',minWidth: 120 },
                { display: '时间', name: 'dateCre',width:'20%', minWidth: 120 },
                {
                    display: '详细', isAllowHide: false,width:'20%', minWidth: 120,
                    render: function (row)
                    {
                        var html = '<a href="#" onclick="toDetail(' + row.id + ')">详细</a>';
                        return html;
                    }
                }
                ], dataAction: 'server', url: '${ctx}/qso/instruct/historyList', sortName: 'id',
                width: '100%', height: '100%', numPerPage:20,rownumbers:true,
                checkbox:false,
                heightDiff: -6
            });
             
            gridManager = $("#maingrid").ligerGetGridManager();

            $("#pageloading").hide();


        });

	
        //聊天详细
        function toDetail(groupId){
        	var geo=getWinGeometry(window);
        	dialog=$.ligerDialog.open({url: '${ctx}/qso/instruct/toDetail/'+groupId,height:geo.height,width:geo.width, showMax: true, showToggle: true, showMin: true,isResize:false,isDrag:false,modal: true, title:"详细"});
        }
        
        function search(){
            if (!gridManager) return;
            var topic = $("#topic").val(); 
            var context = $.trim($("#context").val()); 
            gridManager.setOptions(
                { parms: [{ name: 'search_LIKE_context', value: context},{ name: 'search_LIKE_topic', value: topic}] }
            );
            gridManager.loadData(true);
        }
       

        function reload(){
        	gridManager.loadData();
        }
        
        function getSelectGroupId(){
        	var row = gridManager.getSelected();
            return row?row.id:"";
        }
        

    </script>
</head>
<body style="padding:0px; overflow:hidden;"> 
<div class="l-loading" style="display:block" id="pageloading"></div> 

<div style=" width:100%" id="mainsearch">
    <div class="searchtitle">
        <span>搜索</span>
        <img src="${ctx}/static/icons/32X32/searchtool.gif"/>
        <div class="togglebtn"></div> 
    </div>
    <div style="margin-bottom:4px; margin-top:4px;" class="navline"></div>
    <div class="searchbox">
        <form class="l-form" id="formsearch" ligeruiid="formsearch">
        	<ul>
        		<li style="width:90px;text-align:left;">主题：</li>
        		<li style="width:180px;text-align:left;">
	        		<div class="l-text" style="width: 178px;">
	        			<input type="text" ligerui="{&quot;width&quot;:178}" id="topic" ltype="text" class="field l-text-field" style="width: 174px;">
	        			<div class="l-text-l"></div>
	        			<div class="l-text-r"></div>
	        		</div>
        		</li>
        		<li style="width:40px;"></li>
        		<li style="width:90px;text-align:left;">内容：</li>
        		<li style="width:180px;text-align:left;">
	        		<div class="l-text" style="width: 178px;">
	        			<input type="text" ligerui="{&quot;width&quot;:178}" id="context" ltype="text" class="field l-text-field" style="width: 174px;">
	        			<div class="l-text-l"></div>
	        			<div class="l-text-r"></div>
	        		</div>
        		</li>
        		<li style="width:40px;"></li>
        		<li style="margin-right:8px">
        			<div style="width:60px" class="button button2 buttonnoicon" onclick="search()">
	        			<div class="button-l"> </div>
	        			<div class="button-r"> </div> 
	        			<span>查询</span>
        			</div>
        		</li>
        	</ul>
        	<div class="l-clear"></div>
        </form>
    </div>
</div>

<div id="maingrid" style="margin:0; padding:0"></div>

<div style="display:none;"></div>
 
</body>
</html>
